package lambda;

public class EatableDemo {
    public static void main(String[] args) {
        // 匿名内部类
        useEat(new Eatable() {
            @Override
            public void eet() {
                System.out.println("a apple a day keeps doctor away");
            }
        });

        //lambda
        useEat(() -> {
            System.out.println("a apple a day keeps doctor away");
        });

        //useEat(System.out::println);
    }

    private static void useEat(Eatable eatable){
        eatable.eet();
    }
}
